package day3;

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String str = in.nextLine();
            String cur = "";
            String ret = "";
            int i = 0;
            for( ;i < str.length(); i++) {
                char ch = str.charAt(i);
                if(ch >= '0' && ch <= '9') {
                    cur = cur + ch + "";
                }else {
                    if(cur.length() > ret.length()) {
                        ret = cur;
                    }else {
                        cur = "";
                    }
                }
            }
            if(i == str.length() && cur.length() > ret.length()) {
                ret = cur;
            }
            System.out.println(ret);
        }
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String str = in.nextLine();
            char[] arr = str.toCharArray();
            int count = 0;
            int maxCount = 0;
            int n = -1;
            for(int i = 0; i < arr.length; i++) {
                count = 0;
                int j = i;
                while(j < arr.length && arr[j] >= '0' && arr[j] <= '9') {
                    count++;
                    j++;
                }
                if(maxCount < count) {
                    maxCount = count;
                    n = i;
                }

                i = i + count;

            }
            char[] arr2 = new char[maxCount];
            int j = 0;
            while(maxCount != 0) {
                arr2[j] = arr[n];
                j += 1;
                n += 1;
                maxCount--;
            }
            for(int i = 0; i < arr2.length; i++) {
                System.out.print(arr2[i]);
            }
        }
    }
}